package com.engine.common.util.BasicParamUtil;

import java.math.BigDecimal;

public class ByteArryUtil {

    public static String object2SqlInput(Object param) {
        if (param instanceof Integer)
            return param.toString();
        else if (param instanceof String)
        {
            String s=param.toString().replace("'","\\'");
            return "'"+param.toString()+"'";
        }
        else if (param instanceof Double)
            return param.toString();
        else if (param instanceof Float)
            return param.toString();
        else if (param instanceof Long)
            return param.toString();
        else if (param instanceof Boolean)
            return param.toString();
        else if (param instanceof BigDecimal)
            return param.toString();
        else
            return param.toString();
    }
    public static byte[] ByteMerger(byte[] value1,byte[] value2) {
        if(value2==null)
            return value1;
        int length_byte = value1.length+value2.length;
        byte[] all_byte = new byte[length_byte];
        System.arraycopy(value1, 0, all_byte, 0, value1.length);
        System.arraycopy(value2, 0, all_byte, value1.length, length_byte-value1.length);
        return all_byte;
    }
}
